﻿using System.Reflection.Emit;
using YAPL.Language.Ast.Transformation.Utils;

namespace YAPL.Language.Compiler.CodeGen.ReflectionEmitGenerator.AstGen.Helpers {
	public static class ILGeneratorOperatorExtensions {

		public static void EmitCallUnaryOperator(this ILGenerator ilGen, Ast.UnaryExpression expr) {
			ilGen.Emit(OpCodes.Callvirt, expr.GetOperatorMethod());
		}

		public static void EmitCallBinaryOperator(this ILGenerator ilGen, Ast.BinaryExpression expr) {
			ilGen.Emit(OpCodes.Callvirt, expr.GetOperatorMethod());
		}
	}
}
